﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LineEditTest;
using PSLib.CodeFormating.Lexems;
using System.Windows;

namespace StudioEditorTest.CodeEditor
{
	public class CodeBlock : DependencyObject
	{
		// Using a DependencyProperty as the backing store for Source.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty SourceProperty =
			DependencyProperty.Register("Source", typeof(string), typeof(CodeBlock), new UIPropertyMetadata(string.Empty));

		// Using a DependencyProperty as the backing store for LexemType.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty LexemTypeProperty =
			DependencyProperty.Register("LexemType", typeof(LexemType), typeof(CodeBlock), new UIPropertyMetadata(LexemType.None));

		public CodeBlock()
		{
		}

		protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
		{
			base.OnPropertyChanged(e);
			if (PropertyChanged != null) PropertyChanged(this, e);
		}

		public string Source
		{
			get { return (string)GetValue(SourceProperty); }
			set { SetValue(SourceProperty, value); }
		}

		public LexemType LexemType
		{
			get { return (LexemType)GetValue(LexemTypeProperty); }
			set { SetValue(LexemTypeProperty, value); }
		}

		public event PropertyChangedDelegate PropertyChanged;
	}
}
